package com.design.template;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * 模板方法1
 *
 * @author Zee
 * @version 1.0
 * @date 2021/8/30
 */
@Slf4j
@Component
@Template(TemplateEnum.Type1)
public class Template1 extends AbstractTemplate {
    @Autowired
    private AsyncService asyncService;

    @Override
    protected void temp1Execute() {
        log.info("Template1->temp1Execute");
    }

    @Override
    protected void temp2Execute() {
        log.info("Template1->temp2Execute");
    }

    @Override
    protected void temp3Execute() {
        asyncService.asyncMethod();
        test1();
    }
    public void test1(){
        log.info("Template1->temp3Execute");
    }

}
